<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        // 三点运算符  遍历数组 是数组的扩展运算符
        /* let arr = [1, 5, 8, 9];
        console.log(...arr);
        let arr1 = [1, 5, [5, 9], 8];
        console.log(...arr1);
        // arr.push(...arr1);
        arr.push(arr1);
        console.log(arr); */

        // arguments
        function fun(a) {
            console.log(a);
            // 伪数组
            console.log(arguments);
            console.log(arguments[1]);
            // console.log(arguments.callee);
            /* 包裹它的函数体
            fun(a, b, c) {
            console.log(arguments);
            console.log(arguments.callee);
        } */
        }

        // 可以用来去替代arguments,它比arguments灵活，它是一个真数组。
        function foo(a, b, ...value) {
            console.log(arguments);
            console.log(value);
        }
        foo(1, 5, 8, 9, 8, 5);
    </script>
</body>

</html>